VPC Peering
💡 Definition
VPC Peering is a networking connection between two VPCs that enables you to route traffic between them using private IPv4 or IPv6 addresses. Instances in either VPC can communicate with each other as if they were within the same network.
🔑 Key Concepts
- Private Connection: Traffic stays on the AWS global backbone and never traverses the public internet.
- Non-Transitive: If VPC A peers with B, and B peers with C, A cannot talk to C. You need a direct peer between A and C.
- Cross-Region: You can peer VPCs in different Regions.
- Cross-Account: You can peer VPCs in different AWS Accounts.
⚙️ How it Works
- Request: VPC A sends a peering request to VPC B.
- Accept: VPC B accepts the request.
- Route: Both VPCs must update their route tables to point to the peering connection for the other VPC's IP range.
🎯 Use Cases
- Shared Services: A central services VPC (logging, authentication) accessed by other VPCs.
- Data Transfer: High-speed data transfer between applications in different VPCs.
- Mergers: Connecting networks of two different companies/accounts.
💰 Pricing Model
- Peering Connection: Free to create.
- Data Transfer: Charged for data transfer between the VPCs (same as cross-AZ or cross-Region data transfer).
📝 Exam Tips (CLF-C02)
- Non-Transitive (star topology, not mesh).
- Does not use the internet.
- To connect many VPCs, consider Transit Gateway instead.
See Also: * VPC * Transit Gateway